<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var okk = prompt('查询的物品');
        switch (okk) {
            case '苹果':
                alert('有');
                break;
            case '荔枝':
                alert('没有');
            default:
                alert('都没有');
        }
    </script>
</head>

<body>

</body>

</html>